"""Definition of the Contactenos content type
"""

from zope.interface import implements, directlyProvides

from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

from guegue.alcaldias import alcaldiasMessageFactory as _
from guegue.alcaldias.interfaces import IContactenos
from guegue.alcaldias.config import PROJECTNAME

ContactenosSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

    atapi.StringField('title',
                searchable=1,
                isMetadata=0,
                accessor='Title',
                widget=atapi.StringWidget(label='Nombre',
                                      maxlength=150,
                                      size=30,
                                      label_msgid="label_entry_title",
                                      description_msgid="help_entry_title",
                                      i18n_domain="guegue.alcaldias",
                                      description='')),
    atapi.StringField('area',
                searchable=1,
                isMetadata=0,
                vocabulary=['Comentarios y Sugerencias','Solicitud y Consulta','Seguimiento'],
                widget=atapi.SelectionWidget(label='Area',
                        	label_msgid='label_entry_area',
                	        description_msgid='help_entry_area',
	                        i18n_domain='guegue.alcaldias',
        	                description='')),
    atapi.StringField('cedula',
                searchable=1,
                isMetadata=0,
                widget=atapi.StringWidget(label='No. de Cedula',
                                      label_msgid="label_entry_cedula",
                                      description_msgid="help_entry_cedula",
                                      i18n_domain="guegue.alcaldias",
                                      description='')),
    atapi.DateTimeField('fecha',
                searchable=0,
                required=0,
                widget=atapi.CalendarWidget(label='Fecha',
                                      label_msgid="label_entry_fecha",
                                      show_hm = False,
                                      description_msgid="help_entry_fecha",
                                      i18n_domain="guegue.alcaldias",
                                      description='Fecha de inicio del proyecto')),
    atapi.StringField('correo',
                searchable=1,
                isMetadata=0,
                widget=atapi.StringWidget(label='Correo Electronico',
                                      size=30,
                                      label_msgid="label_entry_correo",
                                      description_msgid="help_entry_correo",
                                      i18n_domain="guegue.alcaldias",
                                      description='')),
    atapi.StringField('telefono',
                searchable=0,
                isMetadata=0,
                widget=atapi.StringWidget(label='Telefono',
                                      label_msgid="label_entry_telefono",
                                      description_msgid="help_entry_telefono",
                                      i18n_domain="guegue.alcaldias",
                                      description='')),
    atapi.StringField('description',
                searchable=1,
                isMetadata=0,
                accessor='Description',
                widget=atapi.TextAreaWidget(label='Mensaje',
                                      label_msgid="label_entry_description",
                                      description_msgid="help_entry_description",
                                      i18n_domain="guegue.alcaldias",
                                      description='')),
))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

#ContactenosSchema['title'].storage = atapi.AnnotationStorage()
#ContactenosSchema['description'].storage = atapi.AnnotationStorage()

schemata.finalizeATCTSchema(ContactenosSchema, moveDiscussion=False)

class Contactenos(base.ATCTContent):
    """Contactenoss de los municipios"""
    implements(IContactenos)

    portal_type = "Contactenos"
    schema = ContactenosSchema

   # title = atapi.ATFieldProperty('title')
   # description = atapi.ATFieldProperty('description')

atapi.registerType(Contactenos, PROJECTNAME)
